/**
 * Created by Wangwei on 2017/1/4.
 */
layui.define(['common'], function (exports) {
    var $=layui.jquery,$global = layui.common,authority={};
    authority.fn={};
    userData = $global.fn.getUserData();
    authority.fn.check = function () {
        if (userData) {
            permissions = userData.permissions;
            for(var p in permissions){
                var permission = permissions[p].permission;
                if (permission.indexOf(":")>0) {
                    permission = permission.replace(":","-")
                }
                // console.log(permission);
                $("."+permission).show();
            }
        }
    };

    // 自检查
    authority.fn.check();
    exports('authority', authority);
});